package com.wnhz.work.yz.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.wnhz.work.yz.BaseActivity;
import com.wnhz.work.yz.R;

import java.util.ArrayList;
import java.util.List;

/**
 * 账单详情
 */
public class BillDetilsActivity extends BaseActivity implements View.OnClickListener {

    private int[] ids = new int[]{R.id.money, R.id.type, R.id.bank_card, R.id.stare, R.id.day_time, R.id.order_number};
    private String[] titles = new String[]{"金额", "支出方式", "银行卡", "当前状态", "创建时间", "订单号"};
    private String[] contexts = new String[]{"¥ 1000", "提现", "建设银行储蓄卡（尾号1234）", "系统处理中", "2016-12-12", "954784485145"};
    private List<TextView> title_tvs = new ArrayList<>();
    private List<TextView> context_tvs = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bill_detils);
        initTitle();

        for (int i = 0; i < ids.length; i++) {
            View view = findViewById(ids[i]);
            TextView title_tv = (TextView) view.findViewById(R.id.title_tv);
            TextView context_tv = (TextView) view.findViewById(R.id.context_tv);
            title_tv.setText(titles[i]);
            String context = contexts[i];
            if (i == 3) {
                context_tv.setTextColor(0xffe9573d);
            }
            context_tv.setText(context);
            context_tvs.add(context_tv);
            title_tvs.add(title_tv);
        }
    }

    private TextView title;

    private void initTitle() {
        title = (TextView) findViewById(R.id.view_main_middle_title);
        title.setText("账单详情");
        findViewById(R.id.btn_main_left).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_main_left:
                finish();
                break;
        }
    }
}
